entrycompletion: Various fixes
authorMatthias Clasen <mclasen@redhat.com>
Wed, 24 Jun 2020 04:26:27 +0000 (00:26 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 24 Jun 2020 17:02:50 +0000 (13:02 -0400)
commitbce518b214fe127aae6d3f14b480761d1105feee
tree0daca56763329d67fcff448467b5b6f5a4cb118e
parent3656994f82585e3b5b65072fb05736fa520b709d
entrycompletion: Various fixes

Fix various issues that prevented inline completion
and inline selection from working reliably. We were
passing byte counts to gtk_editable_select_region in
one place, but that function expects char counts.
We were listening for GtkEditable::insert-text on
the GtkText widget, but that does not emit those signals,
so listen for GtkEntryBuffer::inserted-text instead.
Finally, we were not clearing the stored completion_prefix
enough, leading to situations where the stored prefix
does not match the text in the entry anymore.
gtk/gtkentrycompletion.c